package com.example.vue20220402.dao;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.example.vue20220402.pojo.Power;
import com.example.vue20220402.pojo.Usersinfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author rock
 * @since 2022-04-02
 */
public interface UsersinfoMapper extends BaseMapper<Usersinfo> {

    @Select("select * from user_info where username=#{username} and pwd=#{pwd}")
    Usersinfo login(Usersinfo usersinf);

    //  返回对象里面 包含了页数的所有的数据page 和查询的分页的对象的数据userlist
    IPage<Usersinfo> selectUserList(IPage<Usersinfo> page, @Param(Constants.WRAPPER) Wrapper<Usersinfo> wrapper);

    List<Power> selectPowerList(Integer id);
    //List<Usersinfo> selectUserList(Usersinfo usersinfo);

}
